#pragma once
#ifndef _VECTOR_H
#define _VECTOR_H
#include "..\common\def.h"

struct Vector2f; 
struct EE_EXPORT Vector2i
{
	Vector2i(void)
	:
	x(0),
	y(0)
	{ }
	Vector2i(int X, int Y)
	:
	x(X),
	y(Y)
	{ }
	int x, y; 

	Vector2i operator	-=(const Vector2i &op); 
	Vector2i operator	+=(const Vector2i &op); 
	
	Vector2f operator	* (const float &op) const; 

	float length(void); 

	static void zero(Vector2i *v1); 
}; 

struct EE_EXPORT Vector2f
{
	Vector2f(void) : x(0.0F), y(0.0F)
	{ }

	Vector2f(float X, float Y) : x(X), y(Y)
	{ }

	float	x, y; 
	
	Vector2f operator	+ (const Vector2f &op) const; 
	Vector2f operator	- (const Vector2f &op) const; 
	
	Vector2f operator	-=(const Vector2f &op); 
	Vector2f operator	+=(const Vector2f &op); 
	
	Vector2f operator	* (const float &op) const; 
	
	float length(void); 

	static void zero(Vector2f *v1); 
}; 

struct EE_EXPORT Vector3f
{
	float	x, y, z; 

	static const Vector3f FORWARD; 
	static const Vector3f BACKWARD; 
	static const Vector3f LEFT; 
	static const Vector3f RIGHT; 
	static const Vector3f UP; 
	static const Vector3f DOWN; 

	Vector3f(void) : x(0.0F), y(0.0F), z(0.0F)
	{ }

	Vector3f(const float X, const float Y, const float Z) : x(X), y(Y), z(Z)
	{ }

	Vector3f(const float * p) : x(p[0]), y(p[1]), z(p[2])
	{ }
	
	static inline void zero(Vector3f *v1); 
	static inline float dot(const Vector3f *v1); 
	static inline float dot(const Vector3f *v1, const Vector3f *v2); 
	static inline float distance(const Vector3f *v1, const Vector3f *v2); 
	static inline float distanceSquared(const Vector3f *v1, const Vector3f *v2); 
	static inline float angle(const Vector3f *v1, const Vector3f *v2); 
	static inline void cross(Vector3f *vOut, const Vector3f *v1, const Vector3f *v2); 
	static inline void crossNormalize(Vector3f *vOut, const Vector3f *v1, const Vector3f *v2); 
	static inline Vector3f cross(const Vector3f *v1, const Vector3f *v2); 


	float length(void); 
	void setLength(const float length); 

	static inline void maxVec(Vector3f *pOut, Vector3f *v1, Vector3f *v2); 
	static inline void minVec(Vector3f *pOut, Vector3f *v1, Vector3f *v2); 
	static inline void normalize(Vector3f *v1); 
	static inline float length(Vector3f *v); 
	static inline Vector3f normalOf(const Vector3f *v1); 
	static inline Vector3f rotateAboutAxis(const Vector3f *v, const Vector3f *axis, const float angle); 
	static inline bool isZero(const Vector3f *v1); 

	Vector3f operator	+ (const Vector3f &op) const; 
	Vector3f operator	- (const Vector3f &op) const; 

	Vector3f operator	-=(const Vector3f &op); 
	Vector3f operator	+=(const Vector3f &op); 

	Vector3f operator	/=(const float &op); 
	Vector3f operator	*=(const float &op); 

	Vector3f operator	/ (const float &op) const; 
	Vector3f operator	* (const float &op) const; 
	float operator		* (const Vector3f &op) const; 

	Vector3f operator	=(float *op); 

	bool operator		== (const Vector3f &op) const; 
	bool operator		!= (const Vector3f &op) const; 

	operator float		*(); 
	operator float		* () const; 

	Vector3f operator	+ () const; 
	Vector3f operator	- () const; 
}; 


struct EE_EXPORT VECTOR4F
{
	VECTOR4F() : x(0), y(0), z(0), w(0)
	{
	}
	float	x, y, z, w; 
}; 

#endif